package com.sky.mapper;

import com.sky.entity.Wallets;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.sky.vo.WalletsVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author GHOSTER by RemSynch
 * @since 2024-10-24
 */
@Mapper
public interface WalletsMapper extends BaseMapper<Wallets> {

    @Select("SELECT w.id,sa.username,sa.phone,w.balance,w.frozen_amount,w.updated_at,w.status FROM  sub_accounts sa  INNER JOIN wallets w ON sa.id = w.user_id ORDER BY w.created_at DESC")
    List<WalletsVO> getWallets();

}
